package mall

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"go.uber.org/zap"
	"mall-go-gin/global"
	"mall-go-gin/model/common/response"
	"strconv"
)

type MallGoodsInfoApi struct {
}

func (m *MallGoodsInfoApi) GoodsDetail(c *gin.Context) {
	fmt.Println("========== GoodsDetail ==========")
	id, _ := strconv.Atoi(c.Param("id"))
	err, goodsInfo := mallGoodsInfoService.GetMallGoodsInfo(id)
	if err != nil {
		global.GVA_LOG.Error("查询失败", zap.Error(err))
		response.FailWithMessage("查询失败"+err.Error(), c)
	}
	response.OkWithData(goodsInfo, c)

}
